<div class="panel panel-default" ng-controller="BusRefundListCtrl">
	<div class="panel-heading">
		跨城巴士/ 退款列表
	</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderNo" class="form-control" placeholder="订单编号">
				</div>
			</div>
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="payList.selected" theme="bootstrap">
							<ui-select-match placeholder="支付方式">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="pay in payList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" pay.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="payList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
							<ui-select-match placeholder="退款状态">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="status in statusList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" status.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-4" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.startTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="开始时间" readOnly/>
						<span class="input-group-btn">
								<button type="button" class="btn btn-default" ng-click="open($event)">
									<i class="glyphicon glyphicon-calendar"></i>
								</button>
							</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-4" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.endTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="结束时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-1">
				<div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
			</div>
		</form>
	</div>
	<p class="m-l-xl">
		当前总共：{{bigTotalItems | defaultValue: 0}}条数据 &nbsp;
		已支付总金额：{{orderPaymentTotal |number:2 | defaultValue: 0.00}}元 &nbsp;
		退款总金额：{{orderRefundToatal |number:2 | defaultValue: 0.00}}元 &nbsp;
		手续费总金额：{{serviceCharge |number:2 | defaultValue: 0.00}}元 &nbsp;
		保险金额：{{insurancesToatal |number:2 | defaultValue: 0.00}}元 &nbsp;
		退款批次数：{{batchNo | defaultValue: 0}}次 &nbsp;
		退票数：{{count | defaultValue: 0}}张
	</p>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width:10px;">
					</th>
					<th style="width:80px;">退款编号</th>
					<th style="width:80px;">订单编号</th>
					<th style="width:80px;">申请退款人</th>
					<th style="width:80px;">已支付金额</th>
					<th style="width:60px;">退款金额</th>
					<th style="width:80px;">退款手续费</th>
					<th style="width:80px;">支付方式</th>
					<th style="width:80px;">退款状态</th>
					<th style="width:80px;">申请退款时间</th>
					<th style="width: 70px;">
						<div class="row list-icon">
							<a href tooltip="excel导出" has-authority="BUS_RETURN_EXPORT">
								<i class="fa fa-download" ng-click="exportExcel()"></i>
						 	</a>
						</div>
					</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="refund in dataList">
					<td></td>
					<td>{{refund.refundNo}}</td>
					<td>{{refund.orderNo}}</td>
					<td>{{refund.passenger.name}}</td>
					<td>{{refund.paidPrice|number:2}}</td>
					<td>{{refund.refundPrice|number:2}}</td>
					<td>{{refund.serviceCharge|number:2}}</td>
					<td>{{refund.orderPayment.payment.type | paymentFilter}}</td>
					<td><span ng-if="refund.status==1">退款中</span>
						<span ng-if="refund.status==2">完成退款</span>
						<span ng-if="refund.status==3">退款失败</span></td>
					<td>{{refund.requestTime|date:"yyyy-MM-dd HH:mm:ss"}}</td>
					<td>
						<div class="row list-icon">
							<a href tooltip="详情" ui-sref="app.bus.returnDetail({returnId: refund.id})" target="_blank">
								<i class="icon-info"></i>
							</a>
							<a href tooltip="发起重新退款" ng-click="rerefund(refund)" ng-if="refund.status != 2">
								<i class="fa fa-refresh"></i>
							</a>
						</div>
					</td>
				</tr>
				<tr ng-show="dataList.length==0">
					<td colspan="11" style="text-align: center;">暂无退款信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer/>
</div>